package com.icloud.common.database.enums;

import lombok.Getter;

@Getter
public enum ArticleQueryScopeEnum {
    ATTENTION("ATTENTION"),
    ALL("ALL");

    private final String code;

    ArticleQueryScopeEnum(String code){
        this.code = code;
    }

    public static ArticleQueryScopeEnum byCode(String code) {
        for (ArticleQueryScopeEnum e: ArticleQueryScopeEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }

    public static boolean isAttention(String code){
        return ATTENTION.getCode().equalsIgnoreCase(code);
    }
    public static boolean isAll(String code){
        return ALL.getCode().equalsIgnoreCase(code);
    }
}
